drop proc spa_SEC_GetRolesForUser
go
/*********************************************************************************************    
* PROCEDURE: [spa_SEC_GetRolesForUser]    
* PURPOSE: Get hierarchies of user    
* NOTES:    
* CREATED: Minh Nguyen 08/22/2008    
* MODIFIED:     
    
'-------------------------------------------------------------------------------------------------*    
' Date       | Version | Ticket #    |       Author             | Description    
' ========== | ======= | =========== | =========================| ====================================================================    
' 7/1/2009   | 1.01    |             | Nha Doan                 | Add ClienID param  
'-------------------------------------------------------------------------------------------------*    
*/    
--[spa_SEC_GetRolesForUser] '{21CAFCEA-8629-4FA9-9DC0-85A98AD344D2}'
CREATE PROCEDURE [dbo].[spa_SEC_GetRolesForUser]    
 @UserRecId uniqueidentifier
AS    
    
SELECT    
 h.[RoleId],    
 h.[RoleName],        
 h.[RoleDescription],    
 h.[ActvStatus],
 h.[RoleCode]    
FROM    
 [SEC_UsersInRole] uh (nolock)     
 left join [SEC_Roles] h (nolock) on uh.[RoleId] = h.[RoleId]    
WHERE    
 uh.UserRecId = @UserRecId
 and h.ActvStatus = 1
GO